package com.flyduck.common.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CommonExceptionCode implements ExceptionCode{

    SUCCESS(200, "操作成功"),
    ERROR_PARAM(400, "参数无效"),
    NOT_LOGIN(401, "未登录"),
    NOT_POWER(403, "没有权限"),
    SYSTEM_ERROR(500, "系统错误，请联系管理员!");

    private int code;
    private String message;

    /**
     * 异常类型的数字编号
     */
    @Override
    public Integer getCode(){
        return this.code;
    }

    /**
     * 异常类型的描述
     */
    @Override
    public String getMessage(){
        return this.message;
    }
}
